<?php
# PMB Online
# Aplikasi PMB Online untuk Pendaftaran Calon Mahasiswa di PT/PTS Indonesia
# 
# version 1.0
# class daftar_all
# file
# created Jan 24, 2013 12:13:48 PM
# 
# (c)2012, arif.laksito@gmail.com

if (!defined('BASEPATH'))
    exit('No direct script access allowed');
?>
<h3>Semua Pendaftar</h3>
<ul class="breadcrumb">
    <li>PMB Online <span class="divider">/</span></li>  
    <li>Data Pendaftar <span class="divider">/</span></li>
    <li>Semua Data</li>
</ul>

<?php if ($msg!=''): ?>
    <div class="<?php echo ($sts) ? 'alert alert-success' : 'alert alert-error' ?>">
        <?php echo $msg ?>
    </div>
<?php endif ?>

<script>
$(function() {
<?php foreach ($mhs as $s): ?>                
    $("#dialog_<?php echo $s['nodaf']?>").hide();    
    $("#confirm_<?php echo $s['nodaf'] ?>").click(function(){
        $("#dialog_<?php echo $s['nodaf'] ?>").dialog({            
            height:200,
            modal: false,
            buttons: {
                "Delete": function() {
                    window.location = "<?php echo base_url().'apps/sdelete/'.$s['nodaf']?>";
                    $( this ).dialog( "close" );
                },
                Cancel: function() {
                    $( this ).dialog( "close" );
                }
            }
        });
    });
<?php endforeach; ?>                                        
});
</script>

<?php foreach ($mhs as $h): ?>
    <div id="dialog_<?php echo $h['nodaf'] ?>" title="Hapus Data Pendaftar?">
        <p style="font-size: 12px">
            <span style="font-size: 24px; float: left; margin: 0 7px 50px 0;"><i class="icon-warning-sign"></i></span>
            Data Pendaftar "<?php echo $h['nodaf'].' - '.$h['nama_lengkap']?>" akan dihapus, pastikan tidak ada transaksi pada data tersebut
        </p>
    </div>
<?php endforeach; ?>

<table id="example" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered">
    <thead>
        <tr>            
            <th>No.Daftar</th>
            <th>Tgl.Daftar</th>
            <th>Gelombang</th>
            <th>Nama Lengkap</th>
            <th>Pilihan Jurusan</th>
            <th>Biaya Daftar/<br />Kelengkapan</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        <?php foreach($mhs as $m):?>
        <tr>            
            <td>
                <?php if($m['id_jurusan']!=''):?>
                <a href="<?php echo base_url('apps/rincian/' . $m['nodaf']) ?>" target="_blank" >
                    <?php echo $m['nodaf'] ?>
                </a>
                <?php else:?>
                <?php echo $m['nodaf']?>
                <?php endif?>
            </td>
            <td><?php echo mdate('%d %M %Y',  mysql_to_unix($m['tgl_daftar']))?></td>
            <td><?php echo $m['nama_gel']?></td>
            <td><?php echo $m['nama_lengkap']?></td>
            <td>
                <?php $jur = explode(',',$m['pilihan_jur'])?>
                <?php foreach($jur as $j):?>
                <?php if($j!='') echo $j.'<br />'?>
                <?php endforeach;?>
            </td>
            <td>
                <?php echo ($m['biaya_daftar']==1)?"Lunas":"Blm Lunas"?>/<br />
                <?php echo ($m['kelengkapan']==1)?"Lengkap":"Blm Lengkap"?>
            </td>
            <td class="itbl">
                <?php echo anchor('apps/edit/'.$m['nodaf'], '<i class=icon-pencil></i>') ?>
                <?php echo anchor('apps/edit/'.$m['nodaf'].'/detail', '<i class=icon-edit></i>') ?>
                <a href="#" id="confirm_<?php echo $m['nodaf']?>"><i class="icon-remove"></i></a>
            </td>
        </tr>
        <?php endforeach?>
    </tbody>
</table>    
<br />
<p>
    *) Klik nomer daftar untuk melihat detail rincian biaya (Sudah Lulus)<br />
    <i class="icon-pencil"></i> Edit Data Simple<br />
    <i class="icon-edit"></i> Edit Data Detail<br />
    <i class="icon-remove"></i> Hapus Data<br />
</p>
<br /><br />
<center>
    <?php echo anchor('xls/all','<i class="icon-download-alt"></i> Download Excel','class="btn btn-small btn-primary"')?>           
</center>
<br /><br />